package com.scaleit.weighingsystem;

import com.scaleit.weighingsystem.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.content.Intent;


public class WeighingSystemActivity extends Activity implements OnClickListener {
    
	private Button btnNewOrder;
	private Button btnCustomers;
	private Button btnVehicles;
	private Button btnProducts;
	private Button btnSettings;
	private Button btnExit;

    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        btnNewOrder = (Button)findViewById(R.id.NewOrderBtn);
        btnCustomers = (Button)findViewById(R.id.AccountsBtn);
        btnVehicles = (Button)findViewById(R.id.VehiclesBtn);
        btnProducts = (Button)findViewById(R.id.ProductsBtn);
        btnSettings = (Button)findViewById(R.id.SettingsBtn);
        btnExit = (Button)findViewById(R.id.ExitBtn);
        
        btnNewOrder.setOnClickListener(this);
        btnCustomers.setOnClickListener(this);
        btnVehicles.setOnClickListener(this);
        btnProducts.setOnClickListener(this);
        btnSettings.setOnClickListener(this);
        btnExit.setOnClickListener(this);
    }
    
    @Override
    public void onClick(View v)
    {
    	switch(v.getId())
    	{
    	  case R.id.NewOrderBtn:
    		  startActivity(new Intent("com.scaleit.weighingsystem.NEWORDER"));
    		  break;
    	  case R.id.AccountsBtn:
    		  startActivity(new Intent("com.scaleit.weighingsystem.LVACCOUNTS"));
    		  break;
    	  case R.id.VehiclesBtn:
    		  startActivity(new Intent("com.scaleit.weighingsystem.LVVEHICLES"));
    		  break;
    	  case R.id.ProductsBtn:
    		  startActivity(new Intent("com.scaleit.weighingsystem.LVPRODUCTS"));
    		  break;
    	  case R.id.SettingsBtn:
    		  break;
    	  case R.id.ExitBtn:
    		  this.CloseApplication();
    		  break;
    	}
    }
    
    
    private void CloseApplication()
    {
    	//Do exit stuff here
    	this.finish();
    }
}